package com.hudson.store.index;

import com.hudson.codec.domain.MessageExtBrokerInner;
import com.hudson.store.commitlog.CommitLogManger;

import java.nio.charset.StandardCharsets;
import java.util.Map;

public class IndexTest {

    public static void main(String[] args) {
        Map<Long, Integer> map = IndexService.getIndex("test", "", 100);
        map.forEach((k,v)->{

            MessageExtBrokerInner messageByIndex = CommitLogManger.getMessageByIndex(k, v);
//            System.out.println(messageByIndex);
            System.out.println(new String(messageByIndex.getBody(), StandardCharsets.UTF_8));
        });
    }
}
